2015-09-15(腾工).sql 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. if not exists
  2. (select * from syscolumns where id=object_id('tb_ErpOrdersPhotography') and name='Ordpg_CostPrice')
  3. begin
  4. alter table tb_ErpOrdersPhotography add Ordpg_CostPrice decimal(18, 2) NULL
  5. end
  6. IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' , N'SCHEMA',N'dbo', N'TABLE',N'tb_ErpOrdersPhotography', N'COLUMN',N'Ordpg_CostPrice'))
  7. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'景点成本价' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpOrdersPhotography', @level2type=N'COLUMN',@level2name=N'Ordpg_CostPrice'
  8. GO
  9. if not exists
  10. (select * from syscolumns where id=object_id('tb_ErpCustomer') and name='Cus_IDNumber')
  11. begin
  12. alter table tb_ErpCustomer add Cus_IDNumber nvarchar(2000) NULL
  13. end
  14. IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' , N'SCHEMA',N'dbo', N'TABLE',N'tb_ErpCustomer', N'COLUMN',N'Cus_IDNumber'))
  15. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户身份证号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpCustomer', @level2type=N'COLUMN',@level2name=N'Cus_IDNumber'
  16. GO
  17. if not exists
  18. (select * from syscolumns where id=object_id('tb_ErpCompanyInfo') and name='Company_ChildReserveExplain')
  19. begin
  20. alter table tb_ErpCompanyInfo add Company_ChildReserveExplain nvarchar(2000) NULL
  21. end
  22. IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' , N'SCHEMA',N'dbo', N'TABLE',N'tb_ErpCompanyInfo', N'COLUMN',N'Company_ChildReserveExplain'))
  23. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'预约儿童单说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpCompanyInfo', @level2type=N'COLUMN',@level2name=N'Company_ChildReserveExplain'
  24. GO
  25. if not exists
  26. (select * from syscolumns where id=object_id('tb_ErpCompanyInfo') and name='Company_PortraitReserveExplain')
  27. begin
  28. alter table tb_ErpCompanyInfo add Company_PortraitReserveExplain nvarchar(2000) NULL
  29. end
  30. IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' , N'SCHEMA',N'dbo', N'TABLE',N'tb_ErpCompanyInfo', N'COLUMN',N'Company_PortraitReserveExplain'))
  31. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'预约写真单说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpCompanyInfo', @level2type=N'COLUMN',@level2name=N'Company_PortraitReserveExplain'
  32. GO
  33. update tb_ErpOrderProductList set OPlist_ReservationTakeName = '' where OPlist_ReservationTakeName is null
  34. update tb_ErpOrderProductList set OPlist_ArrangeNmae = '' where OPlist_ArrangeNmae is null
  35. update tb_ErpOrderProductList set OPlist_ArrangeRemark = '' where OPlist_ArrangeRemark is null
  36. update tb_ErpOrderProductList set OPlist_PickupStatus = '0' where OPlist_PickupStatus is null
  37. update tb_ErpOrderProductList set OPlist_PickupName = '' where OPlist_PickupName is null
  38. update tb_ErpOrderProductList set OPlist_PickupQuantity = 0 where OPlist_PickupQuantity is null
  39. update tb_ErpOrderProductList set OPlist_PickupRemark = '' where OPlist_PickupRemark is null
  40. update tb_ErpOrderProductList set OPlist_SendNumber = '' where OPlist_SendNumber is null
  41. update tb_ErpOrderProductList set OPlist_SendStatus = '0' where OPlist_SendStatus is null
  42. update tb_ErpOrderProductList set OPlist_SendVendor = '' where OPlist_SendVendor is null
  43. update tb_ErpOrderProductList set OPlist_SendName = '' where OPlist_SendName is null
  44. update tb_ErpOrderProductList set OPlist_ReworkStatus = '' where OPlist_ReworkStatus is null
  45. update tb_ErpOrderProductList set OPlist_ReworName = '' where OPlist_ReworName is null
  46. update tb_ErpOrderProductList set OPlist_ReworQuantity = 0 where OPlist_ReworQuantity is null
  47. update tb_ErpOrderProductList set OPlist_ReworkRemark = '' where OPlist_ReworkRemark is null
  48. update tb_ErpOrderProductList set OPlist_CompletedStatus = '0' where OPlist_CompletedStatus is null
  49. update tb_ErpOrderProductList set OPlist_CompletedName = '' where OPlist_CompletedName is null
  50. update tb_ErpOrderProductList set OPlist_CompletedQuantity = 0 where OPlist_CompletedQuantity is null
  51. update tb_ErpOrderProductList set OPlist_SelectFilmProductLog = '' where OPlist_SelectFilmProductLog is null
  52. update tb_ErpOrderProductList set OPlist_CreateName = '' where OPlist_CreateName is null